package cn.jiyun.function.service.impl;

import cn.jiyun.function.mapper.DailyRecordMapper;
import cn.jiyun.function.service.DailyRecordService;
import cn.jiyun.pojo.DailyRecord;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DailyRecordServiceImpl implements DailyRecordService {
    @Autowired
    DailyRecordMapper dailyRecordMapper;

    @Override
    public PageInfo<DailyRecord> findAll(Integer pageNum, Integer pageSize, DailyRecord dailyRecord) {
        Page<DailyRecord> dailyRecords = PageHelper.startPage(pageNum, pageSize);
        List<DailyRecord> dailyRecordList = dailyRecordMapper.findPage(dailyRecords,dailyRecord);

        return new PageInfo<>(dailyRecordList);
    }
}
